---@class UIBP_ShowCard_C:UUserWidget
---@field Card1 UUIBP_CardItem_C
---@field Card2 UUIBP_CardItem_C
---@field Card3 UUIBP_CardItem_C
---@field Card4 UUIBP_CardItem_C
---@field Card5 UUIBP_CardItem_C
---@field Card6 UUIBP_CardItem_C
---@field Image_Details UImage
--Edit Below--
local UIBP_ShowCard = { 
    --bInitDoOnce = false;
 }; 


function UIBP_ShowCard:Construct()
	self.bCanEverTick = true;
end


function UIBP_ShowCard:Tick(MyGeometry, InDeltaTime)
    print("UIBP_ShowCard:Tick")
    --only for test
    -- local path = UGCMapInfoLib.GetRootLongPackagePath() .. CardDetailsImg[1]
   
    -- local texture = UE.LoadObject(path)
    -- print("UIBP_ShowCard:Tick ".. path)
    -- self.Image_Details:SetBrushFromTexture(texture);

    local PlayerController = GameplayStatics.GetPlayerController(UGCGameSystem.GameState, 0);
    if PlayerController ~= nil then
        local teamIndex = PlayerController.PlayerState.TeamIndex;
        if UGCGameSystem.GameState.PlayerInfos[teamIndex] ~= nil then
            -- 该用户选中的卡牌
            local cardChoosed = UGCGameSystem.GameState.PlayerInfos[teamIndex].CardChoosed;
            if cardChoosed~=nil then
                local path = UGCMapInfoLib.GetRootLongPackagePath() .. CardDetailsImg[cardChoosed]
                local texture = UE.LoadObject(path)
                self.Image_Details:SetBrushFromTexture(texture);
                print("UIBP_ShowCard:Tick set Image_Details end")
            else
                print("UIBP_ShowCard:Tick cardChoosed is nil")
            end
            
        else
            print("UIBP_ShowCard:Tick get PlayerInfos[teamIndex] failed");
        end
    else
        print("UIBP_ShowCard:Tick get playerController failed");
    end
end

-- function UIBP_ShowCard:Destruct()

-- end

return UIBP_ShowCard;